package com.touchy.touchpad;

import java.io.Serializable;


public class DataPacket implements Serializable {
	
	private String commandType = "";
	private DataHeader dataHeader;
	//private byte[] data;
	private int clickType;
	private float x;
	private float y;
	private boolean click;
	//private int
	public DataPacket() {
		
	}
	
	public DataPacket(float x, float y, DataHeader dataHeader) {
		this.dataHeader= dataHeader; 
		if(dataHeader.isT()) {
			commandType = "mouseMove";
			this.x = x;
			this.y = y;
		}
		else {
			commandType = "mouseClick";
			clickType = dataHeader.getcType();
			if(dataHeader.isT()) {
				click = true;
			}
			else {
				click = false;
			}
		}
		
	}

	public boolean isClick() {
		return click;
	}

	public void setClick(boolean click) {
		this.click = click;
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public String getCommandType() {
		return commandType;
	}

	public void setCommandType(String commandType) {
		this.commandType = commandType;
	}

	public DataHeader getDataHeader() {
		return dataHeader;
	}

	public void setDataHeader(DataHeader dataHeader) {
		this.dataHeader = dataHeader;
	}

	public int getClickType() {
		return clickType;
	}

	public void setClickType(int clickType) {
		this.clickType = clickType;
	}
	

}
